﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.IO;
using System.Data.SqlClient;
using System.Drawing;
using System.Net.Mail;

using System.Web.Services;

using System.IO.MemoryMappedFiles;

public partial class realia_feedback : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

        Image6.ImageUrl = "AgentSecondLast.ashx";
        Image2.ImageUrl = "FirstProperty.ashx";
        Image3.ImageUrl = "SecondLastProperty.ashx";
        Image4.ImageUrl = "ThirdLastProperty.ashx";

        SqlConnection con4 = null;
        con4 = new SqlConnection(ConfigurationManager.ConnectionStrings["ConnStr"].ConnectionString);
        con4.Open();
        SqlCommand hmd4 = new SqlCommand("select * from properties where ID=(SELECT MAX(ID) FROM properties)", con4);

        SqlDataReader hrf4 = hmd4.ExecuteReader();
        // Response.Write(@"<script language='javascript'>alert('loop 1')</script>");

        while (hrf4.Read())
        {

            Label18.Text = hrf4[15].ToString();
            Label19.Text = hrf4[9].ToString();
            Label20.Text = hrf4[21].ToString();
            //Label21.Text =hrf [].ToString ();
            //Label21.Text =hrf [].ToString ();
            //Label4.Text =hrf [].ToString ();
            //    Label6.Text =hrf [].ToString ();
            //Label5.Text =hrf [].ToString ();
            //Label4.Text =hrf [].ToString ();





        }
        hrf4.Close();
        con4.Close();


        SqlConnection con4aaa = null;
        con4aaa = new SqlConnection(ConfigurationManager.ConnectionStrings["ConnStr"].ConnectionString);
        con4aaa.Open();
        SqlCommand hmd4aaa = new SqlCommand("select * from agent_add where ID=(SELECT MAX(ID)-1 FROM agent_add)", con4aaa);

        SqlDataReader hrf4aaa = hmd4aaa.ExecuteReader();
        // Response.Write(@"<script language='javascript'>alert('loop 1')</script>");

        while (hrf4aaa.Read())
        {

            Label30.Text = hrf4aaa[2].ToString();
            Label31.Text = hrf4aaa[15].ToString();
            Label32.Text = hrf4aaa[13].ToString();
            Label34.Text = hrf4aaa[8].ToString();





        }
        hrf4aaa.Close();
        con4aaa.Close();


        SqlConnection con4a = null;
        con4a = new SqlConnection(ConfigurationManager.ConnectionStrings["ConnStr"].ConnectionString);
        con4a.Open();
        SqlCommand hmd4a = new SqlCommand("select * from properties where ID=(SELECT MAX(ID)-1 FROM properties)", con4a);
    

        SqlDataReader hrf4a = hmd4a.ExecuteReader();
        // Response.Write(@"<script language='javascript'>alert('loop 1')</script>");

        while (hrf4a.Read())
        {

            Label21.Text = hrf4a[15].ToString();
            Label22.Text = hrf4a[9].ToString();
            Label23.Text = hrf4a[21].ToString();
            //Label21.Text =hrf [].ToString ();
            //Label21.Text =hrf [].ToString ();
            //Label4.Text =hrf [].ToString ();
            //    Label6.Text =hrf [].ToString ();
            //Label5.Text =hrf [].ToString ();
            //Label4.Text =hrf [].ToString ();





        }
        SqlConnection con4aa = null;
        con4aa = new SqlConnection(ConfigurationManager.ConnectionStrings["ConnStr"].ConnectionString);
        con4aa.Open();
        SqlCommand hmd4aa = new SqlCommand("select * from properties where ID=(SELECT MAX(ID)-2 FROM properties)", con4aa);

        SqlDataReader hrf4aa = hmd4aa.ExecuteReader();
        // Response.Write(@"<script language='javascript'>alert('loop 1')</script>");

        while (hrf4aa.Read())
        {

            Label24.Text = hrf4aa[15].ToString();
            Label25.Text = hrf4aa[9].ToString();
            Label26.Text = hrf4aa[21].ToString();
            //Label21.Text =hrf [].ToString ();
            //Label21.Text =hrf [].ToString ();
            //Label4.Text =hrf [].ToString ();
            //    Label6.Text =hrf [].ToString ();
            //Label5.Text =hrf [].ToString ();
            //Label4.Text =hrf [].ToString ();

        }
    }
}